from django.db import models


# Create your models here.

class Userinfo(models.Model):
    gender_choice = (
        ('1', '男'),
        ('2', '女')
    )
    profession_choice = (
        ('1', '学生'),
        ('2', '老师'),
        ('3', '程序员'),
        ('4', '项目经理'),
        ('5', '其他'),
    )

    userid = models.AutoField(primary_key=True)
    name = models.CharField(max_length=50)
    phone = models.CharField(max_length=50)
    password = models.CharField(max_length=50)
    age = models.IntegerField()
    gender = models.CharField(max_length=2, choices=gender_choice)
    profession = models.CharField(max_length=50, choices=profession_choice)

    # 对应数据库中user表
    class Meta:
        db_table = "user"


class Game(models.Model):
    gameid = models.AutoField(primary_key=True)
    SteamLink = models.CharField(max_length=50)
    SteamID = models.CharField(max_length=50)
    details = models.TextField()
    name = models.CharField(max_length=50)
    price = models.CharField(max_length=50)
    tag = models.CharField(max_length=5555)
    describe = models.TextField()
    assessment = models.TextField()
    IssuingDate = models.TextField()
    FavorableComments = models.TextField()
    developers = models.TextField()
    comment = models.TextField()
    picture = models.TextField()
    grade = models.CharField(max_length=50)

    # 对应数据库中user表
    class Meta:
        db_table = "game"


class Comment(models.Model):
    CID = models.AutoField(primary_key=True)
    userid = models.IntegerField()
    gameid = models.IntegerField()
    content = models.CharField(max_length=50)
    date=models.DateField()
    score = models.FloatField()

    class Meta:
        db_table = "comment"
    pass


class GameTag(models.Model):
    gameid = models.AutoField(primary_key=True)
    tag = models.CharField(max_length=50)

    # 对应数据库中user表
    class Meta:
        db_table = "game_tag"


class GameComment(models.Model):
    num = models.AutoField(primary_key=True)
    gameid = models.IntegerField(max_length=50)
    comment = models.TextField()
    gob = models.CharField(max_length=50)
    userid=models.IntegerField(max_length=50)
    score=models.FloatField()

    # 对应数据库中user表
    class Meta:
        db_table = "game_comment"


class Rating(models.Model):
    userId = models.IntegerField(max_length=50)
    gameId = models.IntegerField(max_length=50)
    rating = models.FloatField()
    id = models.AutoField(primary_key=True)

    # 对应数据库中user表
    class Meta:
        db_table = "rating"


class ClickNum(models.Model):
    userId = models.IntegerField(max_length=50)
    gameId = models.IntegerField(max_length=50)
    click = models.FloatField()
    id = models.AutoField(primary_key=True)

    class Meta:
        db_table = "user_click"

